<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="input">
    <span id="span"></span>
</body>
<script>
    window.onload = function(){
        let obj = {};
        let input = document.getElementById("input");
        let span  = document.getElementById("span");
        Object.defineProperty(obj,'hello',{
            set(newval){
                span.innerText = newval;
                input.value = newval;
            }
        })
        input.addEventListener('keyup',function(){
            obj.hello = this.value;
        })
    }
</script>
</html>